package com.bjsxt;

import java.net.InetAddress;

/**根据IP获取计算机的信息时需要使用getByName("IP")方法创建InetAddress*/
public class InetTest02 {
    public static void main(String[] args) throws Exception{
        InetAddress inetAddress = InetAddress.getByName("39.156.66.14");
        System.out.println(inetAddress.getHostAddress());
        System.out.println(inetAddress.getHostName());
    }
}
